Chris Pollett > Old Classes >
CS185c

( Print View )

Student Corner:
  [Grades Sec3]

  [Submit Sec3]

  [Class Sign Up Sec3]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Quizzes]  [Project]

Practice Exams:
  [Mid]  [Final]

                           












HW#2 --- last modified February 28 2019 22:12:35..

Solution set.

Due date: Oct 5

Files to be submitted:
  Hw2.zip

Purpose: To write code to preserve app state between invocations. To experiment with log writing as a tool to do debugging. To test out your app on an actual phone.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO1 -- Create a working mobile phone application and test it both in a simulator and on a mobile device.

LO2 -- Write a mobile application that involves GUI components and makes use of touch events to manipulate these components.

LO5 -- Write a mobile application that stores program data persistently using an API like sqlite.

Specification:

As with HW1 you can do this homework either using Android or the iPhone. There is a 1pt bonus for doing both.

For this homework you will write a short program to test out different data persistence mechanism of mobile phones. Imagine you are an avid birdwatcher. You would like a simple app to record what birds you have seen, on what day, and where you were at the time. Your app should have three text fields with appropriate labels next to them to collect this information. Beneath these, your app should have an Excito-meter which you can use to indicate how excited you were by the sighting. Beneath this you can have four buttons: Save, Search, Reset, Delete. You can alter the layout of these or use alternatives to buttons if you want to maximize screen real-estate. Still, there must be some user friendly way to make one of these four choices. If the user clicks Save, then the information is saved into a sqlite table. However, if there are any blank fields an alert pops up saying they should fill in the starred fields (you should put a star by them), and no data is saved. If the user hits Search, then a Search in the sqlite database for related entries should be done. Blank fields in a search are allowed and just mean that field won't be used in the search. If someone searches on Excito-meter value, you should return the result which is closest to the Excito-meter value selected. Similarly, for date. The first, best match should be displayed in the text fields as the result of the search. The Reset button just clears all entries on the Main Screen. If all of the fields are set, then Delete deletes the given entry from the sqlite database. Otherwise, delete should pop-up saying you can only delete complete database records. If someone exits your app, I want you to save the current state of the text fields and Excito-meter using file-based persistence, and read that in the next time the app is launched. As you are writing your program you should make use of NSLog or Log to help you do debugging, I will check your code that you have done this in at least a couple places. Finally, the whole point of this class is to get something that actually runs on a phone. So I want you to install your app on a phone then take a recognizable digital picture of it running and include this with your project.

Point Breakdown

Code is formatted and documented in a reasonable manner.1pt
Layout of UI elements is as described.1pt
Functionality of Save, Search, Reset, Delete is as described (1pt each).4pts
Sqlite used as described.1pt
File-based persistence is used to read in previous settings of text fields and Excito-meter.1pt
NSLog or Log statements in code for debugging.1pt
JPG (320x240) of your app on a device.1pt
Total10pts